audio_form object
This method will return the ID of the control that is currently in focus.
int get_current_focus()
Parameters:
None.
Return value:
The ID of the focused control on success, or -1 on failure or if no control is in focus.
Remarks:
None.
Example:
// Make a simple form with a few buttons.
#include "form.bgt"
audio_form form;
void main()
{
form.create_window("Example Form", true);
int ok=form.create_button("OK");
int cancel=form.create_button("E&xit");
while(true)
{
form.monitor();
wait(5);
if(form.is_pressed(ok))
{
alert("Information", "The currently focused control is "+form.get_current_focus());
exit();
}
if(form.is_pressed(cancel))
{
exit();
}
if((key_down(KEY_LMENU))&&(key_pressed(KEY_F4)))
{
exit();
}
}
}